<?php
$root = dirname(__FILE__);
require_once($root.'/assembly.php');
$configs['dbhost'] = '127.0.0.1';
$configs['dbname'] = 'bnz';
$configs['dbusername'] = 'root';
$configs['dbpassword'] = '123456';
$mysqldatasource = new mysqldatasource($configs['dbhost'], $configs['dbname'], $configs['dbusername'], $configs['dbpassword']);
matrix::register('dbexecuter', new dbexecuter($mysqldatasource));

$resquest = new request(); 
$response = new response(); 
var_dump($resquest->c, $resquest->a);exit;
$request_uri = getenv('request_uri');
$tmpstr = explode('/', $request_uri);
$controller = 'indexcontroller';
$templatedir =  'index';
$action = 'index';

if(!empty($tmpstr[1]) && !empty($tmpstr[2]))
{
    $controller = $tmpstr[1].'controller';
    $templatedir = $tmpstr[1]; 
    $action = $tmpstr[2];
}

$controllerobject = new $controller();
$resquest = new request(); 
$response = new response(); 
$controllerobject->$action($resquest, $response);
$models = $response->getModel(); 
foreach($models as $key => $model)
{
    $$key = $model;
}
require_once($root.'/templates/'.$templatedir.'/'.$action.'.php');

?>
